package com.liyiyan.note;

import android.app.ActivityGroup;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.widget.TabHost;


public class NoteActivity extends ActivityGroup {    
    private TabHost tabs;
    final public static String TAG = "NoteActivity";
    final public static String TAG1 = "NoteInsert";
    final public static String TAG2 = "NoteDisplay";
    final public static String TAG3 = "Other";
    private Intent insertNoteIntent;
    private Intent viewNoteIntent;
    private Intent otherIntent;

        
    public void onCreate(Bundle savedInstanceState) {    
        super.onCreate(savedInstanceState);    
        setContentView(R.layout.main);
		this.tabs = (TabHost) findViewById(R.id.tabhost);
		Log.i(TAG, ""+this.tabs);
		this.tabs.setup(this.getLocalActivityManager());
		

		TabHost.TabSpec spec = tabs.newTabSpec(TAG1);
		insertNoteIntent = new Intent(this, NoteInsertActivity.class)
		.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
		spec.setContent(insertNoteIntent);
		spec.setIndicator("Insert");
		tabs.addTab(spec);
		
		spec = tabs.newTabSpec(TAG2);
		viewNoteIntent = new Intent(this, NoteDisplayActivity.class)
		.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
		spec.setContent(viewNoteIntent);
		spec.setIndicator("Display");
		tabs.addTab(spec);
		
		spec = tabs.newTabSpec(TAG3);
		otherIntent = new Intent(this, OtherActivity.class)
		.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
		spec.setContent(otherIntent);
		spec.setIndicator("More");
		tabs.addTab(spec);
		
		
            
    }    
}    

/*
public class NoteActivity extends Activity {
	protected static final String TAG = "NoteActivity";

	/** Called when the activity is first created. */

/*
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);

		Button insertButton = (Button)findViewById(R.id.insertButton);
		Button displayButton = (Button)findViewById(R.id.displayButton);

		insertButton.setOnClickListener(new OnClickListener() {

			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent insertIntent = new Intent(NoteActivity.this, NoteInsertActivity.class);
				startActivity(insertIntent);
			}
		});

		displayButton.setOnClickListener(new OnClickListener() {

			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent insertIntent = new Intent(NoteActivity.this, NoteDisplayActivity.class);
				startActivity(insertIntent);
			}
		});

	}

}
*/